package com.wtwd.campus.wx.utils;

import com.alibaba.fastjson.JSONObject;
import org.jeewx.api.core.req.model.message.TemplateData;
import org.jeewx.api.core.req.model.message.TemplateMessageSendResult;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author ldaoliang
 * @Date create in 14:31 2021/8/4
 * @Description
 */
public class PushModel {

    private static final String OUT_OF_FENCE_TEMPLATE = "IzxhFnuSFyZCrHbAWWuHxGusZIRlROzcXX3QpK069DE";
    private static final String ENTRY_FENCE_TEMPLATE = "3RhXmDhii-2KbCKpU8O5eRCojeon0jEx8Vfc4qYLGJQ";
    private static final String OUT_OF_FENCE_TEMPLATE_RY = "0o34RQXF0-IR1uo1DSaAxfAc0a4g1tq6vVA3kKZ_QpA";
    private static final String ENTRY_FENCE_TEMPLATE_RY = "S0AUGM6tNaVWpw3lLsepN7pHP0u0kOLnKbvqfG7dJrU";
    private static final String ATTENDANCE_RECORD_TEMPLATE = "3arlCaNN8DX38M4t6ILcaj9vm2xE1Blft8R8jhTtHkM";

    //班级通知
    /* private static final String NOTIFICATION_TEMPLATE = "vH5qKMNzyBQGh94qphHEebCKSCgiHiut0C9qrN29xEE";*/
    //学校资讯、班级通知都用这个
    private static final String INFORMATION_TEMPLATE = "AcY_bLyORDC9rSD6KHM6F8p2rl1AYqhWZ1ppT7bovTM";
    //班级通知跳转查看详情的页面地址
    private static final String NOTIFICATION_DETAIL_URL = "https://campus.geelocks.com/wx/index.html?/#/pushDetails:";
    //资讯跳转查看详情的页面地址
    private static final String INFORMATION_DETAIL_URL = "https://campus.geelocks.com/wx/index.html?/#/pushDetails:";
    //推送sos求救模板
    private static final String SOS_TEMPLATE_ID = "01dR-w6FjkuAy8nbaiUs-pU_DmefMtqxnFD35b1GoiU";

    /**
     * 创维推送模板
     */
    //进入围栏提醒
    private static final String ENTRY_FENCE_TEMPLATE_CW = "xR3zKQ7DU-Ld6lpiXWDlY08sxV-ayKy-M_P5wQ5MaDI";
    //出围栏提醒
    private static final String OUT_OF_FENCE_TEMPLATE_CW = "L3kj6cT_C4nBWWzAuDRU6q9WoDD8xXBzhpbUqec3Mu4";
    //学校资讯、班级通知都用这个
    private static final String INFORMATION_TEMPLATE_CW = "mNT6SQRK8zMolgo-o0CPU9yEg5oiNz_Fkk4tMwBDkXQ";
    //SOS
    private static final String SOS_TEMPLATE_ID_CW = "01dR-w6FjkuAy8nbaiUs-pU_DmefMtqxnFD35b1GoiU";


    /**
     * 小湃推送模板
     */
    //进入围栏提醒
    private static final String ENTRY_FENCE_TEMPLATE_XB = "8PQhbo7ZNW4xLQXTtrd6nia-63J70-swYwLjKew1XBE";
    //出围栏提醒
    private static final String OUT_OF_FENCE_TEMPLATE_XB = "n38uCSled_W2ALBR94G38iBmIDVgRKzfqsQCMKjtAPc";
    //学校资讯、班级通知都用这个
    private static final String INFORMATION_TEMPLATE_XB = "tXytQp9ioAuAJj1cpUMgXcW0N47TLW-Jgt-wsQa_thA";
    //SOS
    private static final String SOS_TEMPLATE_ID_XB = "NmER7_EeQusdA3UPMmVM-5g-6a2JgCdBWleJkoiYGnw";

    /**
     * @param studentName
     * @param classesName
     * @param fence
     * @param distance
     * @return
     */

    public static TemplateMessageSendResult createOutFenceTemplate(String studentName, String classesName, String fence, double distance) {
        String format = String.format("%.2f", distance);
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(OUT_OF_FENCE_TEMPLATE);
        Map<String, TemplateData> data = new HashMap<>();
        data.put("first", new TemplateData("尊敬的家长，您的小孩超出围栏。", "#173177"));
        data.put("keyword1", new TemplateData(classesName, "#FF0000"));
        data.put("keyword2", new TemplateData(studentName, "#FF0000"));
        data.put("keyword3", new TemplateData(fence + format + "米", "#FF0000"));
        data.put("remark", new TemplateData(" 为保证安全，请及时联系！", "#173177"));
        template.setData(data);
        return template;
    }

    public static TemplateMessageSendResult createOutFenceTemplateRy(String studentName, String classesName, String fence, double distance) {
        String format = String.format("%.2f", distance);
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(OUT_OF_FENCE_TEMPLATE_RY);
        Map<String, TemplateData> data = new HashMap<>();
        data.put("first", new TemplateData("尊敬的家长，您的小孩超出围栏。", "#173177"));
        data.put("keyword1", new TemplateData(classesName, "#FF0000"));
        data.put("keyword2", new TemplateData(studentName, "#FF0000"));
        data.put("keyword3", new TemplateData(fence + format + "米", "#FF0000"));
        data.put("remark", new TemplateData(" 为保证安全，请及时联系！", "#173177"));
        template.setData(data);
        return template;
    }

    public static TemplateMessageSendResult createOutFenceTemplateCW(String studentName, String classesName, String fence, double distance) {
        String format = String.format("%.2f", distance);
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(OUT_OF_FENCE_TEMPLATE_CW);
        Map<String, TemplateData> data = new HashMap<>();
        data.put("first", new TemplateData("尊敬的家长，您的小孩超出围栏。", "#173177"));
        data.put("keyword1", new TemplateData(classesName, "#FF0000"));
        data.put("keyword2", new TemplateData(studentName, "#FF0000"));
        data.put("keyword3", new TemplateData(fence + format + "米", "#FF0000"));
        data.put("remark", new TemplateData(" 为保证安全，请及时联系！", "#173177"));
        template.setData(data);
        return template;
    }

    public static TemplateMessageSendResult createOutFenceTemplateXB(String studentName, String classesName, String fence, double distance) {
        String format = String.format("%.2f", distance);
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(OUT_OF_FENCE_TEMPLATE_XB);
        Map<String, TemplateData> data = new HashMap<>();
        data.put("first", new TemplateData("尊敬的家长，您的小孩超出围栏。", "#173177"));
        data.put("keyword1", new TemplateData(classesName, "#FF0000"));
        data.put("keyword2", new TemplateData(studentName, "#FF0000"));
        data.put("keyword3", new TemplateData(fence + format + "米", "#FF0000"));
        data.put("remark", new TemplateData(" 为保证安全，请及时联系！", "#173177"));
        template.setData(data);
        return template;
    }

    public static TemplateMessageSendResult createEntryFenceTemplate(String imei, String studentName, String fence) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(ENTRY_FENCE_TEMPLATE);
        Map<String, TemplateData> data = new HashMap<>();
        data.put("first", new TemplateData("尊敬的家长，您的小孩进入围栏。", "#173177"));
        data.put("keyword1", new TemplateData(imei, "#FF0000"));
        data.put("keyword2", new TemplateData(studentName, "#FF0000"));
        data.put("keyword3", new TemplateData(fence, "#FF0000"));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        data.put("keyword4", new TemplateData(sdf.format(new Date(System.currentTimeMillis())), "#FF0000"));
        data.put("remark", new TemplateData("感谢您使用", "#173177"));
        template.setData(data);
        return template;
    }

    /**
     * 创维进入围栏提醒模板
     *
     * @param imei
     * @param studentName
     * @param fence
     * @return
     */
    public static TemplateMessageSendResult createEntryFenceTemplateCW(String imei, String studentName, String fence) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(ENTRY_FENCE_TEMPLATE_CW);
        Map<String, TemplateData> data = new HashMap<>();
        data.put("first", new TemplateData("尊敬的家长，您的小孩进入围栏。", "#173177"));
        data.put("keyword1", new TemplateData(imei, "#FF0000"));
        data.put("keyword2", new TemplateData(studentName, "#FF0000"));
        data.put("keyword3", new TemplateData(fence, "#FF0000"));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        data.put("keyword4", new TemplateData(sdf.format(new Date(System.currentTimeMillis())), "#FF0000"));
        data.put("remark", new TemplateData("感谢您使用", "#173177"));
        template.setData(data);
        return template;
    }

    public static TemplateMessageSendResult createEntryFenceTemplateXB(String imei, String studentName, String fence) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(ENTRY_FENCE_TEMPLATE_XB);
        Map<String, TemplateData> data = new HashMap<>();
        data.put("first", new TemplateData("尊敬的家长，您的小孩进入围栏。", "#173177"));
        data.put("keyword1", new TemplateData(imei, "#FF0000"));
        data.put("keyword2", new TemplateData(studentName, "#FF0000"));
        data.put("keyword3", new TemplateData(fence, "#FF0000"));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        data.put("keyword4", new TemplateData(sdf.format(new Date(System.currentTimeMillis())), "#FF0000"));
        data.put("remark", new TemplateData("感谢您使用", "#173177"));
        template.setData(data);
        return template;
    }

    public static TemplateMessageSendResult createEntryFenceTemplateRy(String imei, String studentName, String fence) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(ENTRY_FENCE_TEMPLATE_RY);
        Map<String, TemplateData> data = new HashMap<>();
        data.put("first", new TemplateData("尊敬的家长，您的小孩进入围栏。", "#173177"));
        data.put("keyword1", new TemplateData(imei, "#FF0000"));
        data.put("keyword2", new TemplateData(studentName, "#FF0000"));
        data.put("keyword3", new TemplateData(fence, "#FF0000"));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        data.put("keyword4", new TemplateData(sdf.format(new Date(System.currentTimeMillis())), "#FF0000"));
        data.put("remark", new TemplateData("感谢您使用", "#173177"));
        template.setData(data);
        return template;
    }

    /**
     * 通知模板
     *
     * @param id
     * @param className
     * @param title
     * @param content
     * @return
     */
    public static TemplateMessageSendResult createNotificationTemplate(Integer id, String className, String title, String content) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(INFORMATION_TEMPLATE);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(new Date(System.currentTimeMillis()));
        data.put("first", new TemplateData("尊敬的家长，您有一条".concat(className).concat("的班级通知。"), "#173177"));
        data.put("keyword2", new TemplateData(timeStr, "#FF0000"));
        content = content.length() > 12 ? content.substring(0, 12).concat("……") : content;
        data.put("keyword3", new TemplateData(content, "#FF0000"));
        data.put("remark", new TemplateData("点击查看详情", "#173177"));
        template.setData(data);
        template.setUrl(NOTIFICATION_DETAIL_URL.concat(String.valueOf(id)).concat(":").concat("1"));
        return template;
    }

    /**
     * 创维通知模板
     *
     * @param id
     * @param className
     * @param title
     * @param content
     * @return
     */
    public static TemplateMessageSendResult createNotificationTemplateCW(Integer id, String className, String title, String content) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(INFORMATION_TEMPLATE_CW);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(new Date(System.currentTimeMillis()));
        data.put("first", new TemplateData("尊敬的家长，您有一条".concat(className).concat("的班级通知。"), "#173177"));
        data.put("keyword2", new TemplateData(timeStr, "#FF0000"));
        content = content.length() > 12 ? content.substring(0, 12).concat("……") : content;
        data.put("keyword3", new TemplateData(content, "#FF0000"));
        data.put("remark", new TemplateData("点击查看详情", "#173177"));
        template.setData(data);
        template.setUrl(NOTIFICATION_DETAIL_URL.concat(String.valueOf(id)).concat(":").concat("1"));
        return template;
    }

    public static TemplateMessageSendResult createNotificationTemplateXB(Integer id, String className, String title, String content) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(INFORMATION_TEMPLATE_XB);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(new Date(System.currentTimeMillis()));
        data.put("first", new TemplateData("尊敬的家长，您有一条".concat(className).concat("的班级通知。"), "#173177"));
        data.put("keyword2", new TemplateData(timeStr, "#FF0000"));
        content = content.length() > 12 ? content.substring(0, 12).concat("……") : content;
        data.put("keyword3", new TemplateData(content, "#FF0000"));
        data.put("remark", new TemplateData("点击查看详情", "#173177"));
        template.setData(data);
        template.setUrl(NOTIFICATION_DETAIL_URL.concat(String.valueOf(id)).concat(":").concat("1"));
        return template;
    }

    /**
     * 告警记录通知模板(开关机、电量不足)
     *
     * @param stuName
     * @param content
     * @param tip
     * @return
     */
    public static TemplateMessageSendResult createWarningTemplate(String stuName, Long time, String content, String tip) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(INFORMATION_TEMPLATE);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(time);
        data.put("first", new TemplateData("尊敬的家长，".concat(tip), "#173177"));
        data.put("keyword1", new TemplateData(stuName.concat("家长"), "#FF0000"));
        data.put("keyword2", new TemplateData(timeStr, "#FF0000"));
        data.put("keyword3", new TemplateData(content, "#FF0000"));
        data.put("remark", new TemplateData("感谢您的使用", "#173177"));
        template.setData(data);
        template.setUrl("");
        return template;
    }

    public static TemplateMessageSendResult createWarningTemplateCW(String stuName, Long time, String content, String tip) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(INFORMATION_TEMPLATE_CW);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(time);
        data.put("first", new TemplateData("尊敬的家长，".concat(tip), "#173177"));
        data.put("keyword1", new TemplateData(stuName.concat("家长"), "#FF0000"));
        data.put("keyword2", new TemplateData(timeStr, "#FF0000"));
        data.put("keyword3", new TemplateData(content, "#FF0000"));
        data.put("remark", new TemplateData("感谢您的使用", "#173177"));
        template.setData(data);
        template.setUrl("");
        return template;
    }

    public static TemplateMessageSendResult createWarningTemplateXB(String stuName, Long time, String content, String tip) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(INFORMATION_TEMPLATE_XB);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(time);
        data.put("first", new TemplateData("尊敬的家长，".concat(tip), "#173177"));
        data.put("keyword1", new TemplateData(stuName.concat("家长"), "#FF0000"));
        data.put("keyword2", new TemplateData(timeStr, "#FF0000"));
        data.put("keyword3", new TemplateData(content, "#FF0000"));
        data.put("remark", new TemplateData("感谢您的使用", "#173177"));
        template.setData(data);
        template.setUrl("");
        return template;
    }
    /**
     * 资讯模板
     *
     * @param id
     * @param type
     * @param title
     * @param content
     * @return
     */
    public static TemplateMessageSendResult createInformationTemplate(Integer id, String type, String title, String content, String schoolName) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(INFORMATION_TEMPLATE);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(new Date(System.currentTimeMillis()));
        data.put("first", new TemplateData("尊敬的家长，您有一条新的学校资讯。", "#173177"));
        data.put("keyword1", new TemplateData(schoolName.concat("全体家长"), "#FF0000"));
        data.put("keyword2", new TemplateData(timeStr, "#FF0000"));
        data.put("keyword3", new TemplateData(title, "#FF0000"));
        data.put("remark", new TemplateData("点击查看详情", "#173177"));
        template.setData(data);
        template.setUrl(INFORMATION_DETAIL_URL.concat(String.valueOf(id)).concat(":").concat("2"));
        return template;
    }

    public static TemplateMessageSendResult createInformationTemplateXB(Integer id, String type, String title, String content, String schoolName) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(INFORMATION_TEMPLATE_XB);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String timeStr = sdf.format(new Date(System.currentTimeMillis()));
        data.put("first", new TemplateData("尊敬的家长，您有一条新的学校资讯。", "#173177"));
        data.put("keyword1", new TemplateData(schoolName.concat("全体家长"), "#FF0000"));
        data.put("keyword2", new TemplateData(timeStr, "#FF0000"));
        data.put("keyword3", new TemplateData(title, "#FF0000"));
        data.put("remark", new TemplateData("点击查看详情", "#173177"));
        template.setData(data);
        template.setUrl(INFORMATION_DETAIL_URL.concat(String.valueOf(id)).concat(":").concat("2"));
        return template;
    }
    /**
     * 打卡记录模板
     *
     * @param content
     * @param stuName
     * @param time
     * @param schoolName
     * @param remark
     * @return
     */
    public static TemplateMessageSendResult createAttendanceRecordTemplate(String content, String stuName, String time, String schoolName, String remark) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(ATTENDANCE_RECORD_TEMPLATE);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        data.put("first", new TemplateData("尊敬的家长，".concat(content), "#173177"));
        data.put("keyword1", new TemplateData(stuName, "#FF0000"));
        data.put("keyword2", new TemplateData(time, "#FF0000"));
        data.put("keyword3", new TemplateData(schoolName, "#FF0000"));
        data.put("remark", new TemplateData(remark, "#173177"));
        template.setData(data);
        return template;
    }

    /**
     * 创建SOS推送模板
     *
     * @param obj
     * @return
     */
    public static TemplateMessageSendResult createSosRecordTemplate(JSONObject obj) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(SOS_TEMPLATE_ID);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        String stuName = obj.getString("stuName");
        Long time = obj.getLong("time");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String content = "尊敬的家长，您的孩子".concat(stuName).concat("在").concat(sdf.format(time)).concat("有一条SOS求救提醒！");
        String schoolName = obj.getString("schoolName");
        String className = obj.getString("className");
        String gradeName = obj.getString("gradeName");
        String address = obj.getString("address");
        data.put("first", new TemplateData(content, "#173177"));
        data.put("keyword1", new TemplateData(schoolName, "#FF0000"));
        data.put("keyword2", new TemplateData(gradeName.concat(className), "#FF0000"));
        data.put("keyword3", new TemplateData(stuName, "#FF0000"));
        data.put("keyword4", new TemplateData(sdf.format(time), "#FF0000"));
        data.put("keyword5", new TemplateData(address, "#FF0000"));
        data.put("remark", new TemplateData("请您关注，谢谢配合！", "#173177"));
        template.setData(data);
        return template;
    }

    public static TemplateMessageSendResult createSosRecordTemplateCW(JSONObject obj) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(SOS_TEMPLATE_ID_CW);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        String stuName = obj.getString("stuName");
        Long time = obj.getLong("time");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String content = "尊敬的家长，您的孩子".concat(stuName).concat("在").concat(sdf.format(time)).concat("有一条SOS求救提醒！");
        String schoolName = obj.getString("schoolName");
        String className = obj.getString("className");
        String gradeName = obj.getString("gradeName");
        String address = obj.getString("address");
        data.put("first", new TemplateData(content, "#173177"));
        data.put("keyword1", new TemplateData(schoolName, "#FF0000"));
        data.put("keyword2", new TemplateData(gradeName.concat(className), "#FF0000"));
        data.put("keyword3", new TemplateData(stuName, "#FF0000"));
        data.put("keyword4", new TemplateData(sdf.format(time), "#FF0000"));
        data.put("keyword5", new TemplateData(address, "#FF0000"));
        data.put("remark", new TemplateData("请您关注，谢谢配合！", "#173177"));
        template.setData(data);
        return template;
    }

    public static TemplateMessageSendResult createSosRecordTemplateXB(JSONObject obj) {
        TemplateMessageSendResult template = new TemplateMessageSendResult();
        template.setTemplate_id(SOS_TEMPLATE_ID_XB);
        Map<String, TemplateData> data = new HashMap<>();
        //设置具体推送信息
        String stuName = obj.getString("stuName");
        Long time = obj.getLong("time");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String content = "尊敬的家长，您的孩子".concat(stuName).concat("在").concat(sdf.format(time)).concat("有一条SOS求救提醒！");
        String schoolName = obj.getString("schoolName");
        String className = obj.getString("className");
        String gradeName = obj.getString("gradeName");
        String address = obj.getString("address");
        data.put("first", new TemplateData(content, "#173177"));
        data.put("keyword1", new TemplateData(schoolName, "#FF0000"));
        data.put("keyword2", new TemplateData(gradeName.concat(className), "#FF0000"));
        data.put("keyword3", new TemplateData(stuName, "#FF0000"));
        data.put("keyword4", new TemplateData(sdf.format(time), "#FF0000"));
        data.put("keyword5", new TemplateData(address, "#FF0000"));
        data.put("remark", new TemplateData("请您关注，谢谢配合！", "#173177"));
        template.setData(data);
        return template;
    }
    public static void main(String[] args) {
        String openId = "iiiiii";
        TemplateMessageSendResult notificationTemplate = createEntryFenceTemplateRy("aaaa", "高三二", "ceshi ");
        notificationTemplate.setUrl("");
        notificationTemplate.setTouser(openId);
        WxUtils.pushMsgRy(notificationTemplate);
    }

}
